home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 24
/
Amiga Format AFCD24 (Feb 1998, Issue 108).iso
/
-seriously_amiga-
/
shareware
/
programming
/
other
/
apic
/
examples
/
ibmkey25.lst
< prev
next >
Wrap
File List
|
1998-01-05
|
79KB
|
1,526 lines
#PIC V1.0 (c)1997 J.Petroglou LIST FILE
#file: dh2:IDE/APICforAMINET/APIC/examples/IBMKEY25.ASM
#date: Sun Dec 14 20:43:20 1997
#pic : PIC16C84
ADDR CODE SRCLINE SOURCECODE
0000 000001 ;KEY.ASM
0000 000002 ; IBM keyboard to Amiga Converter
0000 000003 ;
0000 000004 ;
0000 000005 ; list p=16c84, f=inhx8m ;Enter device name
0000 000006 ; include "p16c84.inc"
0000 000007
0000 000008
0000 000009
0000 000010
0000 000011
0000 000012
0000 000013 ;*******************following lines added**************************************
0000 000014 ;
0000 000015 ;The original source is Copyright © 1997 Stephen Marsden, taken from
0000 000016 ;EPic12.lha, this changes are made to assemble MPASM source on Amiga
0000 000017 ;with PICAsm.
0000 000018 ;
0000 000019 ;
0000 000020 ;Dirk Düsterberg
0000 000021 ;
0000 000022 ; [InterNet] duesterb@unixserv.rz.fh-hannover.de
0000 000023 ; [Homepage] http://linux.rz.fh-hannover.de/~duesterb/
0000 000024 ;
0000 000025
0000 000026
0000 000027
0000 000028 list p=16c84 ;Enter device name
#include 'includes:p16cxx.inc' start
0000 000001 LIST
0000 000002 ; P16CXX.INC Standard PICAsm Header File
0000 000070 LIST
#include end.
0000 000030
0000 000031 ;16c84 spezial register (EECON1) assigns:
0000 000032
0000 000033 CBLOCK 0
0000 000034 RD
0000 000035 WR
0000 000036 WREN
0000 000037 WRERR
0000 000038 EEIF
0000 000039 ENDC
0000 000040
0000 000041 ;******************************************************************************
0000 000042
0000 000043
0000 000044
0000 000045
0000 000046
0000 000047 #DEFINE PAGE0 bcf STATUS,RP0
0000 000048 #DEFINE PAGE1 bsf STATUS,RP0
0000 000049
0000 000050 ;
0000 000051 ;------------------------------------------------------
0000 000052 ;Please define ScratchPadRam here:
0000 000053 ;If you are using PIC16C5X define "ScratchPadRam equ 0x10"
0000 000054 ;else define "ScratchPadRam equ 0x20"
0000 000055 ;-------------------------------------------------------
0000 000056 ;
0000 000057 ScrollLock equ 0x0
0000 000058 NumLock equ 0x1
0000 000059 CapsLock equ 0x2
0000 000060 Kclk equ 0x1
0000 000061 Kdat equ 0x0
0000 000062 Aclk equ 0x4
0000 000063 Adat equ 0x3
0000 000064 Arst equ 0x2
0000 000065 Ctrlbit equ 0x0
0000 000066 RAmigabit equ 0x1
0000 000067 LAmigabit equ 0x2
0000 000068 Keytype equ 0x0
0000 000069 Resetype equ 0x1
0000 000070 ;
0000 000071 ;
0000 000072 ScratchPadRam equ 0x0C
0000 000073 ;
0000 000074 Capbit equ ScratchPadRam+0x0
0000 000075 Capdown equ ScratchPadRam+0x1
0000 000076 CtrlDown equ ScratchPadRam+0x2
0000 000077 RESET equ ScratchPadRam+0x3
0000 000078 Lights equ ScratchPadRam+0x4
0000 000079 Count3 equ ScratchPadRam+0x5
0000 000080 ATparity equ ScratchPadRam+0x6
0000 000081 Make equ ScratchPadRam+0x7
0000 000082 Charbad equ ScratchPadRam+0x8
0000 000083 Oldchar equ ScratchPadRam+0x9
0000 000084 Amigachar equ ScratchPadRam+0xA
0000 000085 Count1 equ ScratchPadRam+0xB
0000 000086 Count2 equ ScratchPadRam+0xC
0000 000087 ATchar equ ScratchPadRam+0xD
0000 000088 tableoffset equ ScratchPadRam+0xE
0000 000089 AltConfig equ ScratchPadRam+0xF
0000 000090 Savechar equ ScratchPadRam+0x10
0000 000091 returnvalue equ ScratchPadRam+0x11
0000 000092 eeaddress equ ScratchPadRam+0x12
0000 000093 eedata equ ScratchPadRam+0x13
0000 000094 win95 equ ScratchPadRam+0x14
0000 000095 Savechar2 equ ScratchPadRam+0x15
0000 000096 ;
0000 000097 ;
0000 000098 org 0x0
0000 2A64 000099 goto start
0001 000100
0001 000101 ATtb1
0001 0082 000102 movwf PCL
0002 344F 000103 retlw 0x4F ;F9
0003 3400 000104 retlw 0x0
0004 3457 000105 retlw 0x57 ;F5
0005 345B 000106 retlw 0x5B ;F3
0006 345F 000107 retlw 0x5F ;F1
0007 345D 000108 retlw 0x5D ;F2
0008 3441 000109 retlw 0x41 ;F12=help
0009 3400 000110 retlw 0x0
000A 344D 000111 retlw 0x4D ;F10
000B 3451 000112 retlw 0x51 ;F8
000C 3455 000113 retlw 0x55 ;F6
000D 3459 000114 retlw 0x59 ;F4
000E 347B 000115 retlw 0x7B ;TAB
000F 34FF 000116 retlw 0xFF ;~
0010 3400 000117 retlw 0x0
0011 000118
0011 3400 000119 retlw 0x0
0012 3437 000120 retlw 0x37 ;Left ALT
0013 343F 000121 retlw 0x3F ;Left SHIFT
0014 3400 000122 retlw 0x0
0015 2900 000123 goto lctrl ;Left Ctrl
0016 34DF 000124 retlw 0xDF ;Q
0017 34FD 000125 retlw 0xFD ;1
0018 3400 000126 retlw 0x0
0019 3400 000127 retlw 0x0
001A 3400 000128 retlw 0x0
001B 349D 000129 retlw 0x9D ;Z
001C 34BD 000130 retlw 0xBD ;S
001D 34BF 000131 retlw 0xBF ;A
001E 34DD 000132 retlw 0xDD ;W
001F 34FB 000133 retlw 0xFB ;2
0020 3400 000134 retlw 0x0
0021 000135
0021 3400 000136 retlw 0x0
0022 3499 000137 retlw 0x99 ;C
0023 349B 000138 retlw 0x9B ;X
0024 34BB 000139 retlw 0xBB ;D
0025 34DB 000140 retlw 0xDB ;E
0026 34F7 000141 retlw 0xF7 ;4
0027 34F9 000142 retlw 0xF9 ;3
0028 3400 000143 retlw 0x0
0029 3400 000144 retlw 0x0
002A 347F 000145 retlw 0x7F ;SPACE
002B 3497 000146 retlw 0x97 ;V
002C 34B9 000147 retlw 0xB9 ;F
002D 34D7 000148 retlw 0xD7 ;T
002E 34D9 000149 retlw 0xD9 ;R
002F 34F5 000150 retlw 0xF5 ;5
0030 3400 000151 retlw 0x0
0031 000152
0031 3400 000153 retlw 0x0
0032 3493 000154 retlw 0x93 ;N
0033 3495 000155 retlw 0x95 ;B
0034 34B5 000156 retlw 0xB5 ;H
0035 34B7 000157 retlw 0xB7 ;G
0036 34D5 000158 retlw 0xD5 ;Y
0037 34F3 000159 retlw 0xF3 ;6
0038 3400 000160 retlw 0x0
0039 3400 000161 retlw 0x0
003A 3400 000162 retlw 0x0
003B 3491 000163 retlw 0x91 ;M
003C 34B3 000164 retlw 0xB3 ;J
003D 34D3 000165 retlw 0xD3 ;U
003E 34F1 000166 retlw 0xF1 ;7
003F 34EF 000167 retlw 0xEF ;8
0040 3400 000168 retlw 0x0
0041 000169
0041 3400 000170 retlw 0x0
0042 348F 000171 retlw 0x8F ;<
0043 34B1 000172 retlw 0xB1 ;K
0044 34D1 000173 retlw 0xD1 ;I
0045 34CF 000174 retlw 0xCF ;O
0046 34EB 000175 retlw 0xEB ;0
0047 34ED 000176 retlw 0xED ;9
0048 3400 000177 retlw 0x0
0049 3400 000178 retlw 0x0
004A 348D 000179 retlw 0x8D ;>
004B 348B 000180 retlw 0x8B ;/
004C 34AF 000181 retlw 0xAF ;L
004D 34AD 000182 retlw 0xAD ; ';'
004E 34CD 000183 retlw 0xCD ;P
004F 34E9 000184 retlw 0xE9 ;-
0050 3400 000185 retlw 0x0
0051 000186
0051 3400 000187 retlw 0x0
0052 3400 000188 retlw 0x0
0053 34AB 000189 retlw 0xAB ;@
0054 3400 000190 retlw 0x0
0055 34CB 000191 retlw 0xCB ;[
0056 34E7 000192 retlw 0xE7 ;=
0057 3400 000193 retlw 0x0
0058 3400 000194 retlw 0x0
0059 343B 000195 retlw 0x3B ;CAPS LOCK?
005A 343D 000196 retlw 0x3D ;Right SHIFT
005B 3477 000197 retlw 0x77 ;RETURN
005C 34C9 000198 retlw 0xC9 ;]
005D 3400 000199 retlw 0x0
005E 34A9 000200 retlw 0xA9 ;#=right foreign key
005F 3400 000201 retlw 0x0
0060 3400 000202 retlw 0x0
0061 000203
0061 3400 000204 retlw 0x0
0062 349F 000205 retlw 0x9F ;\ (next to left shift on AT keyboard)
0063 3400 000206 retlw 0x0
0064 3400 000207 retlw 0x0
0065 3400 000208 retlw 0x0
0066 3400 000209 retlw 0x0
0067 347D 000210 retlw 0x7D ;Back SPACE
0068 3400 000211 retlw 0x0
0069 3400 000212 retlw 0x0
006A 34C5 000213 retlw 0xC5 ;1 keypad
006B 3400 000214 retlw 0x0
006C 34A5 000215 retlw 0xA5 ;4 keypad
006D 3485 000216 retlw 0x85 ;7 keypad
006E 3400 000217 retlw 0x0
006F 3400 000218 retlw 0x0
0070 3400 000219 retlw 0x0
0071 000220
0071 34E1 000221 retlw 0xE1 ;0 keypad
0072 3487 000222 retlw 0x87 ;dot keypad
0073 34C3 000223 retlw 0xC3 ;2 keypad
0074 34A3 000224 retlw 0xA3 ;5 keypad
0075 34A1 000225 retlw 0xA1 ;6 keypad
0076 3483 000226 retlw 0x83 ;8 keypad
0077 3475 000227 retlw 0x75 ;ESCAPE!
0078 344B 000228 retlw 0x4B ;Number Lock=( keypad
0079 34E5 000229 retlw 0xE5 ;F11=\
007A 3443 000230 retlw 0x43 ;+ keypad
007B 34C1 000231 retlw 0xC1 ;3 keypad
007C 346B 000232 retlw 0x6B ;- keypad
007D 3445 000233 retlw 0x45 ;* keypad
007E 3481 000234 retlw 0x81 ;9 keypad
007F 3449 000235 retlw 0x49 ;scroll Lock=) keypad
0080 3400 000236 retlw 0x0
0081 000237
0081 000238 ATtb2:
0081 3400 000239 retlw 0x0
0082 3400 000240 retlw 0x0
0083 3400 000241 retlw 0x0
0084 3453 000242 retlw 0x53 ;F7
0085 290D 000243 goto prtscreen ;print screen=R Amiga P
0086 3400 000244 retlw 0x0
0087 3400 000245 retlw 0x0
0088 3400 000246 retlw 0x0
0089 3400 000247 retlw 0x0
008A 3400 000248 retlw 0x0
008B 3400 000249 retlw 0x0
008C 3400 000250 retlw 0x0
008D 3400 000251 retlw 0x0
008E 3400 000252 retlw 0x0
008F 3400 000253 retlw 0x0
0090 3400 000254 retlw 0x0
0091 000255
0091 3400 000256 retlw 0x0
0092 3435 000257 retlw 0x35 ;Right ALT
0093 3400 000258 retlw 0x0
0094 3400 000259 retlw 0x0
0095 2903 000260 goto rctrl ;Right CTL
0096 3400 000261 retlw 0x0
0097 3400 000262 retlw 0x0
0098 3400 000263 retlw 0x0
0099 3400 000264 retlw 0x0
009A 3400 000265 retlw 0x0
009B 3400 000266 retlw 0x0
009C 3400 000267 retlw 0x0
009D 3400 000268 retlw 0x0
009E 3400 000269 retlw 0x0
009F 3400 000270 retlw 0x0
00A0 3433 000271 retlw 0x33 ;Left Win=Left Amiga
00A1 000272
00A1 3400 000273 retlw 0x0
00A2 3400 000274 retlw 0x0
00A3 3400 000275 retlw 0x0
00A4 3400 000276 retlw 0x0
00A5 3400 000277 retlw 0x0
00A6 3400 000278 retlw 0x0
00A7 3400 000279 retlw 0x0
00A8 3431 000280 retlw 0x31 ;Right Win=Right Amiga
00A9 3400 000281 retlw 0x0
00AA 3400 000282 retlw 0x0
00AB 3400 000283 retlw 0x0
00AC 3400 000284 retlw 0x0
00AD 3400 000285 retlw 0x0
00AE 3400 000286 retlw 0x0
00AF 3400 000287 retlw 0x0
00B0 2906 000288 goto swapscreen ;Menu Key=L-Amiga M
00B1 000289
00B1 3400 000290 retlw 0x0
00B2 3400 000291 retlw 0x0
00B3 3400 000292 retlw 0x0
00B4 3400 000293 retlw 0x0
00B5 3400 000294 retlw 0x0
00B6 3400 000295 retlw 0x0
00B7 3400 000296 retlw 0x0
00B8 3400 000297 retlw 0x0
00B9 3400 000298 retlw 0x0
00BA 3400 000299 retlw 0x0
00BB 3400 000300 retlw 0x0
00BC 3400 000301 retlw 0x0
00BD 3400 000302 retlw 0x0
00BE 3400 000303 retlw 0x0
00BF 3400 000304 retlw 0x0
00C0 3400 000305 retlw 0x0
00C1 000306
00C1 3400 000307 retlw 0x0
00C2 3400 000308 retlw 0x0
00C3 3400 000309 retlw 0x0
00C4 3400 000310 retlw 0x0
00C5 3400 000311 retlw 0x0
00C6 3400 000312 retlw 0x0
00C7 3400 000313 retlw 0x0
00C8 3400 000314 retlw 0x0
00C9 3400 000315 retlw 0x0
00CA 3400 000316 retlw 0x0
00CB 348B 000317 retlw 0x8B ;/key, supposedly
00CC 3400 000318 retlw 0x0
00CD 3400 000319 retlw 0x0
00CE 3400 000320 retlw 0x0
00CF 3400 000321 retlw 0x0
00D0 3400 000322 retlw 0x0
00D1 000323
00D1 3400 000324 retlw 0x0
00D2 3400 000325 retlw 0x0
00D3 3400 000326 retlw 0x0
00D4 3400 000327 retlw 0x0
00D5 3400 000328 retlw 0x0
00D6 3400 000329 retlw 0x0
00D7 3400 000330 retlw 0x0
00D8 3400 000331 retlw 0x0
00D9 3400 000332 retlw 0x0
00DA 3400 000333 retlw 0x0
00DB 3479 000334 retlw 0x79 ;Numeric Enter
00DC 3400 000335 retlw 0x0
00DD 3400 000336 retlw 0x0
00DE 3400 000337 retlw 0x0
00DF 3400 000338 retlw 0x0
00E0 3400 000339 retlw 0x0
00E1 000340
00E1 3400 000341 retlw 0x0
00E2 3400 000342 retlw 0x0
00E3 3400 000343 retlw 0x0
00E4 3400 000344 retlw 0x0
00E5 3400 000345 retlw 0x0
00E6 3400 000346 retlw 0x0
00E7 3400 000347 retlw 0x0
00E8 3400 000348 retlw 0x0
00E9 3400 000349 retlw 0x0
00EA 2914 000350 goto endkey ;End=Shift right-cursor
00EB 3400 000351 retlw 0x0
00EC 3461 000352 retlw 0x61 ;Cursor Left
00ED 291B 000353 goto home ;Home=Shift left-cursor
00EE 3400 000354 retlw 0x0
00EF 3400 000355 retlw 0x0
00F0 3463 000356 retlw 0x63 ;MACRO key=control
00F1 000357
00F1 2930 000358 goto insert ;Insert=Right Amiga 7
00F2 3473 000359 retlw 0x73 ;Delete
00F3 3465 000360 retlw 0x65 ;Cursor Down
00F4 3400 000361 retlw 0x0
00F5 3463 000362 retlw 0x63 ;Cursor Right
00F6 3467 000363 retlw 0x67 ;Cursor Up
00F7 3400 000364 retlw 0x0
00F8 3400 000365 retlw 0x0
00F9 3400 000366 retlw 0x0
00FA 3400 000367 retlw 0x0
00FB 2922 000368 goto pagedown ;Page Down=Shift down-cursor
00FC 3400 000369 retlw 0x0
00FD 290D 000370 goto prtscreen ;print screen=Right Amiga P
00FE 2929 000371 goto pageup ;Page up=Shift up-cursor
00FF 2937 000372 goto break ;Break=Ctrl-C
0100 000373 ; retlw 0x0
0100 000374
0100 000375
0100 000376
0100 000377 ; *** Left Control key ***
0100 000378 lctrl
0100 1820 000379 btfsc win95,0x0
0101 3439 000380 retlw 0x39 ; ctrl
0102 3433 000381 retlw 0x33 ; left Amiga
0103 000382
0103 000383 ; *** Right Control key ***
0103 000384 rctrl
0103 1820 000385 btfsc win95,0x0
0104 3439 000386 retlw 0x39 ; ctrl
0105 3431 000387 retlw 0x31 ; right Amiga
0106 000388
0106 000389
0106 000390 ; *** Menu = Left Amiga-M ***
0106 000391 swapscreen
0106 3033 000392 movlw 0x33 ; Left Amiga pressed
0107 21A0 000393 call actualtransmit
0108 3091 000394 movlw 0x91 ; M pressed & released
0109 23B5 000395 call sendmessage
010A 3032 000396 movlw 0x32 ; Left Amiga released
010B 21A0 000397 call actualtransmit
010C 3400 000398 retlw 0x0
010D 000399
010D 000400
010D 000401 ; *** Prt Scrn Key = Right Amiga-P ***
010D 000402 prtscreen
010D 3031 000403 movlw 0x31 ; Right Amiga pressed
010E 21A0 000404 call actualtransmit
010F 30CD 000405 movlw 0xCD ; P pressed & released
0110 23B5 000406 call sendmessage
0111 3030 000407 movlw 0x30 ; Right Amiga released
0112 21A0 000408 call actualtransmit
0113 3400 000409 retlw 0x0
0114 000410
0114 000411
0114 000412
0114 000413 ; *** End Key = Shift right-cursor ***
0114 000414 endkey
0114 303D 000415 movlw 0x3D ; Right shift pressed
0115 21A0 000416 call actualtransmit
0116 3063 000417 movlw 0x63 ; right-cursor pressed & released
0117 23B5 000418 call sendmessage
0118 303C 000419 movlw 0x3C ; Right shift released
0119 21A0 000420 call actualtransmit
011A 3400 000421 retlw 0x0
011B 000422
011B 000423
011B 000424
011B 000425 ; *** Home Key = Shift left-cursor ***
011B 000426 home
011B 303D 000427 movlw 0x3D ; Right shift pressed
011C 21A0 000428 call actualtransmit
011D 3061 000429 movlw 0x61 ; left-cursor pressed & released
011E 23B5 000430 call sendmessage
011F 303C 000431 movlw 0x3C ; Right shift released
0120 21A0 000432 call actualtransmit
0121 3400 000433 retlw 0x0
0122 000434
0122 000435
0122 000436
0122 000437 ; *** PageDown Key = Shift down-cursor ***
0122 000438 pagedown
0122 303D 000439 movlw 0x3D ; Right shift pressed
0123 21A0 000440 call actualtransmit
0124 3065 000441 movlw 0x65 ; down-cursor pressed & released
0125 23B5 000442 call sendmessage
0126 303C 000443 movlw 0x3C ; Right shift released
0127 21A0 000444 call actualtransmit
0128 3400 000445 retlw 0x0
0129 000446
0129 000447
0129 000448
0129 000449 ; *** Pageup Key = Shift up-cursor ***
0129 000450 pageup
0129 303D 000451 movlw 0x3D ; Right shift pressed
012A 21A0 000452 call actualtransmit
012B 3067 000453 movlw 0x67 ; up-cursor pressed & released
012C 23B5 000454 call sendmessage
012D 303C 000455 movlw 0x3C ; Right shift released
012E 21A0 000456 call actualtransmit
012F 3400 000457 retlw 0x0
0130 000458
0130 000459
0130 000460
0130 000461 ; *** Insert Key = Right Amiga 7 ***
0130 000462 insert
0130 3031 000463 movlw 0x31 ; Right Amiga pressed
0131 21A0 000464 call actualtransmit
0132 30F1 000465 movlw 0xF1 ; 7 pressed & released
0133 23B5 000466 call sendmessage
0134 3030 000467 movlw 0x30 ; Right Amiga released
0135 21A0 000468 call actualtransmit
0136 3400 000469 retlw 0x0
0137 000470
0137 000471
0137 000472
0137 000473 ; *** Break Key = Ctrl-C ***
0137 000474 break
0137 3039 000475 movlw 0x39 ; Ctrl pressed
0138 21A0 000476 call actualtransmit
0139 3099 000477 movlw 0x99 ; C pressed & released
013A 23B5 000478 call sendmessage
013B 3038 000479 movlw 0x38 ; Ctrl released
013C 21A0 000480 call actualtransmit
013D 3400 000481 retlw 0x0
013E 000482
013E 000483
013E 000484
013E 000485 ; *** Wait a long time ***
013E 000486 longdelay
013E 0097 000487 movwf Count1
013F 000488 dly
013F 2143 000489 call fixeddelay
0140 0B97 000490 decfsz Count1,F
0141 293F 000491 goto dly
0142 0008 000492 return
0143 000493 ;
0143 000494 ; *** Wait a short while ***
0143 000495 fixeddelay
0143 30FF 000496 movlw 0xFF
0144 000497 smalldelay
0144 0098 000498 movwf Count2
0145 000499 delay
0145 0B98 000500 decfsz Count2,F
0146 2945 000501 goto delay
0147 0008 000502 return
0148 000503
0148 000504
0148 000505
0148 000506
0148 000507 ; *** Send character to Amiga and wait for handshake ***
0148 000508 amigatransmit
0148 0096 000509 movwf Amigachar
0149 0215 000510 subwf Oldchar,W
014A 1903 000511 btfsc STATUS,Z ; skip if not equal
014B 0008 000512 return ; ignore it
014C 000513
014C 3033 000514 movlw 0x33 ; LAmiga pressed
014D 0216 000515 subwf Amigachar,W
014E 1903 000516 btfsc STATUS,Z ; skip if not equal
014F 110F 000517 bcf RESET,LAmigabit
0150 3032 000518 movlw 0x32 ; LAmiga released
0151 0216 000519 subwf Amigachar,W
0152 1903 000520 btfsc STATUS,Z ; skip if not equal
0153 150F 000521 bsf RESET,LAmigabit
0154 000522
0154 3031 000523 movlw 0x31 ; RAmiga pressed
0155 0216 000524 subwf Amigachar,W
0156 1903 000525 btfsc STATUS,Z ; skip if not equal
0157 108F 000526 bcf RESET,RAmigabit
0158 3030 000527 movlw 0x30 ; RAmiga released
0159 0216 000528 subwf Amigachar,W
015A 1903 000529 btfsc STATUS,Z ; skip if not equal
015B 148F 000530 bsf RESET,RAmigabit
015C 000531
015C 303B 000532 movlw 0x3B ; jump if not Capslock down
015D 0216 000533 subwf Amigachar,W
015E 1D03 000534 btfss STATUS,Z ; skip if equal
015F 2966 000535 goto transok2 ; ignore it
0160 100F 000536 bcf RESET,Ctrlbit
0161 0816 000537 movf Amigachar,W
0162 0095 000538 movwf Oldchar
0163 30FF 000539 movlw 0xFF
0164 008D 000540 movwf Capdown ; set flags for later
0165 0008 000541 return
0166 000542 transok2
0166 303A 000543 movlw 0x3A ; jump if not Capslock up
0167 0216 000544 subwf Amigachar,W
0168 1D03 000545 btfss STATUS,Z ; skip if equal
0169 2984 000546 goto transok3 ; ignore it
016A 000547
016A 140F 000548 bsf RESET,Ctrlbit
016B 303B 000549 movlw 0x3B ; see if Capslock was just down
016C 0215 000550 subwf Oldchar,W ;
016D 1D03 000551 btfss STATUS,Z ; skip if equal
016E 297D 000552 goto transok4 ; use as Ctrl key
016F 018D 000553 clrf Capdown ; clear flag
0170 098C 000554 comf Capbit,F ; toggle down/upness of caplock
0171 303B 000555 movlw 0x3B ; send Capslock down
0172 1C0C 000556 btfss Capbit,0x0
0173 39FE 000557 andlw 0xFE
0174 21A0 000558 call actualtransmit
0175 000559 ; send lights to AT
0175 30ED 000560 movlw 0xED ; Next data is for lights
0176 21D7 000561 call SendtoAT
0177 1510 000562 bsf Lights,CapsLock ; Capslock on
0178 1C0C 000563 btfss Capbit,0x0
0179 1110 000564 bcf Lights,CapsLock ; Capslock off
017A 0810 000565 movf Lights,W
017B 21D7 000566 call SendtoAT
017C 0008 000567 return
017D 000568 transok4
017D 1820 000569 btfsc win95,0x0
017E 0008 000570 return
017F 018E 000571 clrf CtrlDown
0180 018D 000572 clrf Capdown ; Capslock has finished acting as ctrl
0181 3038 000573 movlw 0x38 ; send Ctrl up
0182 21A0 000574 call actualtransmit
0183 0008 000575 return
0184 000576 transok3
0184 0816 000577 movf Amigachar,W
0185 00A1 000578 movwf Savechar2
0186 0095 000579 movwf Oldchar
0187 088D 000580 movf Capdown,F ; Capslock down?
0188 1903 000581 btfsc STATUS,Z ; skip if non-zero i.e caps pressed
0189 2995 000582 goto nocontrol ; ignore it
018A 1820 000583 btfsc win95,0x0
018B 2995 000584 goto nocontrol ; ignore it
018C 088E 000585 movf CtrlDown,F
018D 1D03 000586 btfss STATUS,Z ; skip if zero i.e caps pressed
018E 2995 000587 goto nocontrol ; ignore it
018F 30FF 000588 movlw 0xFF
0190 008E 000589 movwf CtrlDown ; Caps lock is now Ctrl key
0191 3039 000590 movlw 0x39 ; send Ctrl down
0192 21A0 000591 call actualtransmit
0193 0821 000592 movf Savechar2,W
0194 29A0 000593 goto actualtransmit
0195 000594 nocontrol
0195 0816 000595 movf Amigachar,W
0196 39FE 000596 andlw 0xFE
0197 3C44 000597 sublw 0x44 ; * (Numkey) released
0198 1D03 000598 btfss STATUS,Z ; skip if equal
0199 019B 000599 clrf AltConfig
019A 0A9B 000600 incf AltConfig,F
019B 000601
019B 3028 000602 movlw 0x28 ; 20 th time?
019C 021B 000603 subwf AltConfig,W
019D 1903 000604 btfsc STATUS,Z ; skip if not equal
019E 22F9 000605 call config
019F 000606
019F 000607
019F 0816 000608 movf Amigachar,W
01A0 000609
01A0 000610 actualtransmit
01A0 0096 000611 movwf Amigachar
01A1 000612
01A1 3005 000613 movlw .5 ; do a 5x256 delay
01A2 213E 000614 call longdelay
01A3 000615 actual2
01A3 3008 000616 movlw .8
01A4 0097 000617 movwf Count1
01A5 0194 000618 clrf Charbad
01A6 000619 f
01A6 1B96 000620 btfsc Amigachar,0x7 ; IF bit7=1 THEN Adat=1
01A7 1585 000621 bsf PORTA,Adat
01A8 1F96 000622 btfss Amigachar,0x7 ; IF bit7=0 THEN Adat=0
01A9 1185 000623 bcf PORTA,Adat
01AA 3008 000624 movlw .8
01AB 2144 000625 call smalldelay ; Allow Adat logic to settle
01AC 1205 000626 bcf PORTA,Aclk ; transmit
01AD 3008 000627 movlw .8
01AE 2144 000628 call smalldelay ; Allow Aclk logic to settle
01AF 1605 000629 bsf PORTA,Aclk ; reset Aclk=1
01B0 300A 000630 movlw .10
01B1 2144 000631 call smalldelay ; Allow Aclk logic to settle
01B2 0D96 000632 rlf Amigachar,F
01B3 0B97 000633 decfsz Count1,F ; Transmit next bit?
01B4 29A6 000634 goto f
01B5 000635
01B5 300F 000636 movlw 0xF
01B6 0097 000637 movwf Count1
01B7 30FF 000638 movlw 0xFF
01B8 0097 000639 movwf Count1
01B9 0098 000640 movwf Count2
01BA 000641
01BA 1683 000642 PAGE1
01BB 1585 000643 bsf TRISA,Adat ; Read acknowledge signal
01BC 1283 000644 PAGE0
01BD 000645 ack
01BD 0397 000646 decf Count1,F
01BE 1903 000647 btfsc STATUS,Z
01BF 0398 000648 decf Count2,F
01C0 0818 000649 movf Count2,W ; Count2=0?
01C1 1903 000650 btfsc STATUS,Z
01C2 29CC 000651 goto syncup ; no handshake
01C3 1985 000652 btfsc PORTA,Adat ; wait for handshake from amiga
01C4 29BD 000653 goto ack
01C5 000654 ready
01C5 1D85 000655 btfss PORTA,Adat ; wait for handshake to finish
01C6 29C5 000656 goto ready
01C7 000657
01C7 1585 000658 bsf PORTA,Adat ; reset Adat=1
01C8 1683 000659 PAGE1
01C9 1185 000660 bcf TRISA,Adat ; Return to output mode
01CA 1283 000661 PAGE0
01CB 0008 000662 return
01CC 000663 syncup
01CC 1205 000664 bcf PORTA,Aclk ; send another clock pulse
01CD 3008 000665 movlw .8
01CE 2144 000666 call smalldelay ; Allow Aclk logic to settle
01CF 1605 000667 bsf PORTA,Aclk ; reset Aclk=1
01D0 30FF 000668 movlw 0xFF
01D1 0097 000669 movwf Count1
01D2 0098 000670 movwf Count2
01D3 0391 000671 decf Count3,F
01D4 1903 000672 btfsc STATUS,Z
01D5 0008 000673 return
01D6 29BD 000674 goto ack ; wait for acknowledge again
01D7 000675
01D7 000676
01D7 000677
01D7 000678 ; *** Send character to AT keyboard and wait for handshake ***
01D7 000679 SendtoAT
01D7 0094 000680 movwf Charbad
01D8 000681 resend
01D8 0814 000682 movf Charbad,W
01D9 0099 000683 movwf ATchar
01DA 0192 000684 clrf ATparity
01DB 1486 000685 bsf PORTB,Kclk ; Kclk=1 get keyboards attention
01DC 0000 000686 nop
01DD 1006 000687 bcf PORTB,Kdat ; Kdat=0 get keyboards attention
01DE 1683 000688 PAGE1
01DF 1086 000689 bcf TRISB,Kclk ; Kclk is in output mode
01E0 0000 000690 nop
01E1 1006 000691 bcf TRISB,Kdat ; Kdat is in output mode
01E2 1283 000692 PAGE0
01E3 3008 000693 movlw .8
01E4 0097 000694 movwf Count1
01E5 1683 000695 PAGE1
01E6 1486 000696 bsf TRISB,Kclk ; Kclk is in input mode
01E7 1283 000697 PAGE0
01E8 1886 000698 Send4 btfsc PORTB,Kclk ; wait for keyboard to make Kclk=0
01E9 29E8 000699 goto Send4
01EA 1819 000700 btfsc ATchar,0x0 ; IF bit0=1 THEN Kdat=1
01EB 1406 000701 bsf PORTB,Kdat
01EC 1C19 000702 btfss ATchar,0x0 ; IF bit0=0 THEN Kdat=0
01ED 1006 000703 bcf PORTB,Kdat
01EE 0C99 000704 rrf ATchar,F ; next bit
01EF 1803 000705 btfsc STATUS,C ; test parity of bit shifted out
01F0 0A92 000706 incf ATparity,F
01F1 1C86 000707 Send5 btfss PORTB,Kclk ; wait for keyboard to make Kclk=1
01F2 29F1 000708 goto Send5
01F3 0B97 000709 decfsz Count1,F
01F4 29E8 000710 goto Send4
01F5 1886 000711 Send6 btfsc PORTB,Kclk ; wait for keyboard to make Kclk=0
01F6 29F5 000712 goto Send6
01F7 1812 000713 btfsc ATparity,0x0 ; IF bit0=odd THEN Kdat=0 (odd parity)
01F8 1006 000714 bcf PORTB,Kdat
01F9 1C12 000715 btfss ATparity,0x0 ; IF bit0=even THEN Kdat=1 (odd parity)
01FA 1406 000716 bsf PORTB,Kdat
01FB 1C86 000717 Send7 btfss PORTB,Kclk ; wait for keyboard to make Kclk=1
01FC 29FB 000718 goto Send7
01FD 1886 000719 Send77 btfsc PORTB,Kclk ; wait for keyboard to make Kclk=0
01FE 29FD 000720 goto Send77
01FF 1406 000721 bsf PORTB,Kdat ; stop bit
0200 1C86 000722 Send78 btfss PORTB,Kclk ; wait for keyboard to make Kclk=1
0201 2A00 000723 goto Send78
0202 1683 000724 PAGE1
0203 1406 000725 bsf TRISB,Kdat ; reset Kdat back to input mode
0204 1283 000726 PAGE0
0205 1886 000727 Send79 btfsc PORTB,Kclk ; wait for keyboard to make Kclk=0
0206 2A05 000728 goto Send79
0207 1C86 000729 Send7a btfss PORTB,Kclk ; wait for keyboard to make Kclk=1
0208 2A07 000730 goto Send7a
0209 3008 000731 movlw .8
020A 2144 000732 call smalldelay ; Allow Kclk logic to settle
020B 1086 000733 bcf PORTB,Kclk ; Kclk=0 Send handshake
020C 1683 000734 PAGE1
020D 1086 000735 bcf TRISB,Kclk ; Kclk is in output mode
020E 1283 000736 PAGE0
020F 3014 000737 movlw .20
0210 2144 000738 call smalldelay ; Allow keyboard chance
0211 2217 000739 call ATgetkey
0212 30FA 000740 movlw 0xFA ; Was transmission ok
0213 0219 000741 subwf ATchar,W
0214 1D03 000742 btfss STATUS,Z ; skip if good
0215 29D8 000743 goto resend
0216 0008 000744 return
0217 000745
0217 000746
0217 000747
0217 000748
0217 000749 ; *** Waits for keyboard to send code ***
0217 000750 ATgetkey
0217 0199 000751 clrf ATchar
0218 1486 000752 bsf PORTB,Kclk ; Kclk=1 Allow keyboard to talk
0219 1683 000753 PAGE1
021A 1486 000754 bsf TRISB,Kclk ; Kclk is in input mode
021B 1283 000755 PAGE0
021C 1886 000756 skip1st btfsc PORTB,Kclk ; wait for keyboard to make Kclk=0
021D 2A1C 000757 goto skip1st
021E 1C86 000758 skippy btfss PORTB,Kclk ; wait for keyboard to make Kclk=1
021F 2A1E 000759 goto skippy
0220 3008 000760 movlw .8
0221 0097 000761 movwf Count1
0222 000762 ATwait0
0222 1886 000763 btfsc PORTB,Kclk ; wait for keyboard to make Kclk=0
0223 2A22 000764 goto ATwait0
0224 0C99 000765 rrf ATchar,F
0225 1806 000766 btfsc PORTB,Kdat
0226 1799 000767 bsf ATchar,0x7
0227 1C06 000768 btfss PORTB,Kdat
0228 1399 000769 bcf ATchar,0x7
0229 1C86 000770 ATwait1 btfss PORTB,Kclk ; wait for keyboard to make Kclk=1
022A 2A29 000771 goto ATwait1
022B 0B97 000772 decfsz Count1,F
022C 2A22 000773 goto ATwait0 ; get all 8 bits of data
022D 1886 000774 parity0 btfsc PORTB,Kclk ; wait for keyboard to make Kclk=0
022E 2A2D 000775 goto parity0
022F 1C86 000776 parity1 btfss PORTB,Kclk ; wait for keyboard to make Kclk=1
0230 2A2F 000777 goto parity1
0231 1886 000778 stop0 btfsc PORTB,Kclk ; wait for keyboard to make Kclk=0
0232 2A31 000779 goto stop0
0233 1C86 000780 stop1 btfss PORTB,Kclk ; wait for keyboard to make Kclk=1
0234 2A33 000781 goto stop1
0235 1086 000782 bcf PORTB,Kclk ; Kclk=0 Send handshake
0236 1683 000783 PAGE1
0237 1086 000784 bcf TRISB,Kclk ; Kclk is in output mode
0238 1283 000785 PAGE0
0239 3014 000786 movlw .20
023A 2144 000787 call smalldelay ; Allow keyboard chance to recieve
023B 0008 000788 return
023C 000789
023C 000790
023C 000791
023C 000792
023C 000793
023C 000794 ; *** Flash Light ***
023C 000795 flash
023C 0090 000796 movwf Lights
023D 30ED 000797 movlw 0xED ; Next data is for lights
023E 21D7 000798 call SendtoAT
023F 0810 000799 movf Lights,W ; Flash lights
0240 21D7 000800 call SendtoAT
0241 3025 000801 movlw 0x25
0242 213E 000802 call longdelay
0243 30ED 000803 movlw 0xED ; Next data is for lights
0244 21D7 000804 call SendtoAT
0245 3000 000805 movlw 0x0 ; Clear Lights
0246 21D7 000806 call SendtoAT
0247 3025 000807 movlw 0x25
0248 213E 000808 call longdelay
0249 0008 000809 return
024A 000810
024A 000811
024A 000812
024A 000813 ; *** Performs reset on Amiga ***
024A 000814 reset
024A 3001 000815 movlw Resetype
024B 23D8 000816 call readdata
024C 3C01 000817 sublw 0x1
024D 1903 000818 btfsc STATUS,Z ; skip if not equal
024E 2A5B 000819 goto kill ; jump if fast reset
024F 300F 000820 movlw 0x0F ; Tell amiga we are going to reset it
0250 21A0 000821 call actualtransmit
0251 000822
0251 3008 000823 movlw 0x8
0252 0091 000824 movwf Count3
0253 3001 000825 strobe movlw 0x1
0254 223C 000826 call flash
0255 3002 000827 movlw 0x2
0256 223C 000828 call flash
0257 3004 000829 movlw 0x4
0258 223C 000830 call flash
0259 0B91 000831 decfsz Count3,F
025A 2A53 000832 goto strobe
025B 000833 kill
025B 3070 000834 movlw 0x70
025C 213E 000835 call longdelay
025D 1106 000836 bcf PORTB,Arst ; Arst=0 Send reset
025E 1683 000837 PAGE1
025F 1106 000838 bcf TRISB,Arst ; Arst is in output mode
0260 1283 000839 PAGE0
0261 30FF 000840 movlw 0xFF
0262 213E 000841 call longdelay ; Wait for Amiga to reset
0263 2A6E 000842 goto start2
0264 000843
0264 000844
0264 000845
0264 000846
0264 000847 start
0264 000848
0264 000849 ; *** Allow time for HardDrive to spin upto speed ***
0264 000850 SpinUp
0264 1106 000851 bcf PORTB,Arst ; Arst=0 Send reset
0265 1683 000852 PAGE1
0266 1106 000853 bcf TRISB,Arst ; Arst is in output mode
0267 1283 000854 PAGE0
0268 3030 000855 movlw 0x30
0269 0091 000856 movwf Count3
026A 000857 waitHD
026A 30FF 000858 movlw 0xFF
026B 213E 000859 call longdelay ; Wait for drive to wake up
026C 0B91 000860 decfsz Count3,F
026D 2A6A 000861 goto waitHD
026E 000862
026E 000863 start2
026E 000864 ; *** Setup ports ***
026E 1605 000865 bsf PORTA,Aclk ; transmit
026F 0000 000866 nop
0270 1585 000867 bsf PORTA,Adat
0271 1683 000868 PAGE1
0272 3007 000869 movlw 0x7
0273 0085 000870 movwf TRISA
0274 30FF 000871 movlw 0xFF
0275 0086 000872 movwf TRISB
0276 1283 000873 PAGE0
0277 000874
0277 000875
0277 000876 ; *** Clear out miscellaneous flags ***
0277 018D 000877 clrf Capdown
0278 018E 000878 clrf CtrlDown
0279 018C 000879 clrf Capbit
027A 0195 000880 clrf Oldchar
027B 019B 000881 clrf AltConfig
027C 3007 000882 movlw 0x7
027D 008F 000883 movwf RESET
027E 000884
027E 000885 ; *** See what sort of keyboard is attached ***
027E 01A0 000886 clrf win95
027F 3000 000887 movlw Keytype
0280 23D8 000888 call readdata
0281 3C02 000889 sublw 0x2
0282 1903 000890 btfsc STATUS,Z ; skip if not equal
0283 09A0 000891 comf win95 ; win95=true or false
0284 000892
0284 000893 ; *** Wait for AT keyboard to power up ***
0284 000894 waitAT
0284 1C06 000895 btfss PORTB,Kdat ; wait for AT keyboard
0285 2A84 000896 goto waitAT
0286 000897
0286 000898 ; *** Reset AT keyboard ***
0286 000899 ; movlw 0xFF ; Reset
0286 000900 ; call SendtoAT
0286 30F6 000901 movlw 0xF6 ; Default
0287 21D7 000902 call SendtoAT
0288 3007 000903 movlw 0x7
0289 223C 000904 call flash
028A 30ED 000905 movlw 0xED ; Next data is for lights
028B 21D7 000906 call SendtoAT
028C 3002 000907 movlw 0x2
028D 0090 000908 movwf Lights
028E 21D7 000909 call SendtoAT
028F 30F4 000910 movlw 0xF4 ; Clear buffer
0290 21D7 000911 call SendtoAT
0291 000912
0291 000913
0291 000914 ATstyle
0291 088F 000915 movf RESET,F
0292 1903 000916 btfsc STATUS,Z
0293 2A4A 000917 goto reset
0294 2217 000918 call ATgetkey
0295 30E1 000919 movlw 0xE1
0296 0219 000920 subwf ATchar,W
0297 1D03 000921 btfss STATUS,Z ; skip if equal
0298 2AA1 000922 goto ATnE1
0299 2217 000923 call ATgetkey ; should be $14
029A 2217 000924 call ATgetkey ; should be $77
029B 2217 000925 call ATgetkey ; should be $E1
029C 2217 000926 call ATgetkey ; should be $F0
029D 2217 000927 call ATgetkey ; should be $14
029E 2217 000928 call ATgetkey ; should be $F0
029F 2217 000929 call ATgetkey ; should be $77
02A0 2A91 000930 goto ATstyle
02A1 000931 ATnE1
02A1 019A 000932 clrf tableoffset
02A2 30E0 000933 movlw 0xE0
02A3 0219 000934 subwf ATchar,W
02A4 1D03 000935 btfss STATUS,Z ; skip if equal
02A5 2AC0 000936 goto ATnE0
02A6 3080 000937 movlw 0x80
02A7 009A 000938 movwf tableoffset
02A8 2217 000939 call ATgetkey
02A9 30F0 000940 movlw 0xF0
02AA 0219 000941 subwf ATchar,W
02AB 1D03 000942 btfss STATUS,Z ; skip if equal
02AC 2AB7 000943 goto ATnE0F0
02AD 2217 000944 call ATgetkey
02AE 3012 000945 movlw 0x12
02AF 0219 000946 subwf ATchar,W
02B0 1903 000947 btfsc STATUS,Z ; skip if not equal
02B1 2A91 000948 goto ATstyle ; E0F012 ignore it
02B2 000949 ATnEF12
02B2 3059 000950 movlw 0x59
02B3 0219 000951 subwf ATchar,W
02B4 1D03 000952 btfss STATUS,Z ; skip if equal
02B5 2ACD 000953 goto ATup
02B6 2A91 000954 goto ATstyle ; E0F059 ignore it
02B7 000955 ATnE0F0
02B7 3012 000956 movlw 0x12
02B8 0219 000957 subwf ATchar,W
02B9 1903 000958 btfsc STATUS,Z ; skip if not equal
02BA 2A91 000959 goto ATstyle ; E012 ignore it
02BB 000960 ATnE012
02BB 3059 000961 movlw 0x59
02BC 0219 000962 subwf ATchar,W
02BD 1D03 000963 btfss STATUS,Z ; skip if equal
02BE 2AC6 000964 goto ATdown
02BF 2A91 000965 goto ATstyle ; E059 ignore it
02C0 000966 ATnE0
02C0 30F0 000967 movlw 0xF0
02C1 0219 000968 subwf ATchar,W
02C2 1D03 000969 btfss STATUS,Z ; skip if equal
02C3 2AC6 000970 goto ATdown
02C4 2217 000971 call ATgetkey
02C5 2ACD 000972 goto ATup ; F0= key released
02C6 000973 ATdown
02C6 0A19 000974 incf ATchar,W
02C7 071A 000975 addwf tableoffset,W
02C8 2001 000976 call ATtb1
02C9 3E00 000977 addlw 0x0 ; test W
02CA 1D03 000978 btfss STATUS,Z
02CB 2148 000979 call amigatransmit
02CC 2A91 000980 goto ATstyle
02CD 000981 ATup
02CD 0A19 000982 incf ATchar,W
02CE 071A 000983 addwf tableoffset,W
02CF 009A 000984 movwf tableoffset
02D0 000985
02D0 30B0 000986 movlw 0xAF+1 ; menu key
02D1 021A 000987 subwf tableoffset,W
02D2 1903 000988 btfsc STATUS,Z ; skip if not equal
02D3 2A91 000989 goto ATstyle ; ignore it
02D4 000990
02D4 3085 000991 movlw 0x84+1 ; PrtScrn
02D5 021A 000992 subwf tableoffset,W
02D6 1903 000993 btfsc STATUS,Z ; skip if not equal
02D7 2A91 000994 goto ATstyle ; ignore it
02D8 000995
02D8 30EA 000996 movlw 0xE9+1 ; End
02D9 021A 000997 subwf tableoffset,W
02DA 1903 000998 btfsc STATUS,Z ; skip if not equal
02DB 2A91 000999 goto ATstyle ; ignore it
02DC 001000
02DC 30ED 001001 movlw 0xEC+1 ; Home
02DD 021A 001002 subwf tableoffset,W
02DE 1903 001003 btfsc STATUS,Z ; skip if not equal
02DF 2A91 001004 goto ATstyle ; ignore it
02E0 001005
02E0 30F1 001006 movlw 0xF0+1 ; Insert
02E1 021A 001007 subwf tableoffset,W
02E2 1903 001008 btfsc STATUS,Z ; skip if not equal
02E3 2A91 001009 goto ATstyle ; ignore it
02E4 001010
02E4 30FB 001011 movlw 0xFA+1 ; PageDown
02E5 021A 001012 subwf tableoffset,W
02E6 1903 001013 btfsc STATUS,Z ; skip if not equal
02E7 2A91 001014 goto ATstyle ; ignore it
02E8 001015
02E8 30FD 001016 movlw 0xFC+1 ; PrtScrn
02E9 021A 001017 subwf tableoffset,W
02EA 1903 001018 btfsc STATUS,Z ; skip if not equal
02EB 2A91 001019 goto ATstyle ; ignore it
02EC 001020
02EC 30FE 001021 movlw 0xFD+1 ; PageUp
02ED 021A 001022 subwf tableoffset,W
02EE 1903 001023 btfsc STATUS,Z ; skip if not equal
02EF 2A91 001024 goto ATstyle ; ignore it
02F0 001025
02F0 30FF 001026 movlw 0xFE+1 ; Break
02F1 021A 001027 subwf tableoffset,W
02F2 1903 001028 btfsc STATUS,Z ; skip if not equal
02F3 2A91 001029 goto ATstyle ; ignore it
02F4 001030
02F4 081A 001031 movf tableoffset,W
02F5 2001 001032 call ATtb1
02F6 39FE 001033 andlw 0xFE ; clear bit 0
02F7 2148 001034 call amigatransmit
02F8 2A91 001035 goto ATstyle
02F9 001036
02F9 001037
02F9 001038
02F9 001039
02F9 001040
02F9 001041
02F9 001042
02F9 001043
02F9 001044
02F9 001045
02F9 001046
02F9 001047
02F9 001048
02F9 001049
02F9 001050 ; *** Change configuration ***
02F9 001051 config
02F9 019E 001052 clrf eeaddress
02FA 303B 001053 movlw 0x3B ; CAPSLOCK ON
02FB 21A0 001054 call actualtransmit
02FC 001055
02FC 235C 001056 call say_select ; Select Type of
02FD 237E 001057 call say_key ; key
02FE 3095 001058 movlw 0x95 ; b
02FF 23B5 001059 call sendmessage
0300 30CF 001060 movlw 0xCF ; o
0301 23B5 001061 call sendmessage
0302 30BF 001062 movlw 0xBF ; a
0303 23B5 001063 call sendmessage
0304 30D9 001064 movlw 0xD9 ; r
0305 23B5 001065 call sendmessage
0306 30BB 001066 movlw 0xBB ; d
0307 23B5 001067 call sendmessage
0308 2385 001068 call say_option1 ; 1=
0309 2398 001069 call say_uk10 ; uk 10
030A 30FB 001070 movlw 0xFB ; 2
030B 23B5 001071 call sendmessage
030C 307F 001072 movlw 0x7F ; space
030D 23B5 001073 call sendmessage
030E 237E 001074 call say_key ; key
030F 238F 001075 call say_option2 ; 2=
0310 2398 001076 call say_uk10 ; uk 10
0311 30F5 001077 movlw 0xF5 ; 5
0312 23B5 001078 call sendmessage
0313 307F 001079 movlw 0x7F ; space
0314 23B5 001080 call sendmessage
0315 237E 001081 call say_key ; key
0316 307F 001082 movlw 0x7F ; space
0317 23B5 001083 call sendmessage
0318 30DD 001084 movlw 0xDD ; w
0319 23B5 001085 call sendmessage
031A 30D1 001086 movlw 0xD1 ; i
031B 23B5 001087 call sendmessage
031C 3093 001088 movlw 0x93 ; n
031D 23B5 001089 call sendmessage
031E 30ED 001090 movlw 0xED ; 9
031F 23B5 001091 call sendmessage
0320 30F5 001092 movlw 0xF5 ; 5
0321 23B5 001093 call sendmessage
0322 3077 001094 movlw 0x77 ; return
0323 23B5 001095 call sendmessage
0324 23BC 001096 call getselection
0325 009F 001097 movwf eedata
0326 081F 001098 movf eedata,W
0327 1903 001099 btfsc STATUS,Z ; skip if not zero
0328 2AF9 001100 goto config ; bad choice, try again
0329 23C8 001101 call writedata
032A 23A3 001102 call say_ok
032B 01A0 001103 clrf win95
032C 3000 001104 movlw Keytype
032D 23D8 001105 call readdata
032E 3C02 001106 sublw 0x2
032F 1903 001107 btfsc STATUS,Z ; skip if not equal
0330 09A0 001108 comf win95 ; win95=true or false
0331 001109
0331 0A9E 001110 incf eeaddress
0332 001111 askreset
0332 235C 001112 call say_select ; Select Type of
0333 23AA 001113 call say_reset ; reset
0334 2385 001114 call say_option1 ; 1=
0335 30B9 001115 movlw 0xB9 ; f
0336 23B5 001116 call sendmessage
0337 30BF 001117 movlw 0xBF ; a
0338 23B5 001118 call sendmessage
0339 30BD 001119 movlw 0xBD ; s
033A 23B5 001120 call sendmessage
033B 30D7 001121 movlw 0xD7 ; t
033C 23B5 001122 call sendmessage
033D 307F 001123 movlw 0x7F ; space
033E 23B5 001124 call sendmessage
033F 23AA 001125 call say_reset ; reset
0340 238F 001126 call say_option2 ; 2=
0341 30BD 001127 movlw 0xBD ; s
0342 23B5 001128 call sendmessage
0343 30AF 001129 movlw 0xAF ; l
0344 23B5 001130 call sendmessage
0345 30CF 001131 movlw 0xCF ; o
0346 23B5 001132 call sendmessage
0347 30DD 001133 movlw 0xDD ; w
0348 23B5 001134 call sendmessage
0349 307F 001135 movlw 0x7F ; space
034A 23B5 001136 call sendmessage
034B 23AA 001137 call say_reset ; reset
034C 3077 001138 movlw 0x77 ; return
034D 23B5 001139 call sendmessage
034E 001140
034E 23BC 001141 call getselection
034F 009F 001142 movwf eedata
0350 081F 001143 movf eedata,W
0351 1903 001144 btfsc STATUS,Z ; skip if not zero
0352 2B32 001145 goto askreset ; bad choice, try again
0353 23C8 001146 call writedata
0354 23A3 001147 call say_ok
0355 001148
0355 019B 001149 clrf AltConfig
0356 307E 001150 movlw 0x7E ; space up
0357 088D 001151 movf Capdown,F ; Capslock down?
0358 1903 001152 btfsc STATUS,Z ; skip if non-zero i.e caps pressed
0359 303A 001153 movlw 0x3A ; Caps up
035A 0096 001154 movwf Amigachar
035B 0008 001155 return
035C 001156
035C 001157 say_select
035C 3077 001158 movlw 0x77 ; return x2
035D 23B5 001159 call sendmessage
035E 23B5 001160 call sendmessage
035F 30BD 001161 movlw 0xBD ; s
0360 23B5 001162 call sendmessage
0361 30DB 001163 movlw 0xDB ; e
0362 23B5 001164 call sendmessage
0363 30AF 001165 movlw 0xAF ; l
0364 23B5 001166 call sendmessage
0365 30DB 001167 movlw 0xDB ; e
0366 23B5 001168 call sendmessage
0367 3099 001169 movlw 0x99 ; c
0368 23B5 001170 call sendmessage
0369 30D7 001171 movlw 0xD7 ; t
036A 23B5 001172 call sendmessage
036B 307F 001173 movlw 0x7F ; space
036C 23B5 001174 call sendmessage
036D 30D7 001175 movlw 0xD7 ; t
036E 23B5 001176 call sendmessage
036F 30D5 001177 movlw 0xD5 ; y
0370 23B5 001178 call sendmessage
0371 30CD 001179 movlw 0xCD ; p
0372 23B5 001180 call sendmessage
0373 30DB 001181 movlw 0xDB ; e
0374 23B5 001182 call sendmessage
0375 307F 001183 movlw 0x7F ; space
0376 23B5 001184 call sendmessage
0377 30CF 001185 movlw 0xCF ; o
0378 23B5 001186 call sendmessage
0379 30B9 001187 movlw 0xB9 ; f
037A 23B5 001188 call sendmessage
037B 307F 001189 movlw 0x7F ; space
037C 23B5 001190 call sendmessage
037D 0008 001191 return
037E 001192
037E 001193 say_key
037E 30B1 001194 movlw 0xB1 ; k
037F 23B5 001195 call sendmessage
0380 30DB 001196 movlw 0xDB ; e
0381 23B5 001197 call sendmessage
0382 30D5 001198 movlw 0xD5 ; y
0383 23B5 001199 call sendmessage
0384 0008 001200 return
0385 001201
0385 001202 say_option1
0385 3077 001203 movlw 0x77 ; return x2
0386 23B5 001204 call sendmessage
0387 23B5 001205 call sendmessage
0388 30FD 001206 movlw 0xFD ; 1
0389 23B5 001207 call sendmessage
038A 30E7 001208 movlw 0xE7 ; =
038B 23B5 001209 call sendmessage
038C 307F 001210 movlw 0x7F ; space
038D 23B5 001211 call sendmessage
038E 0008 001212 return
038F 001213
038F 001214 say_option2
038F 3077 001215 movlw 0x77 ; return
0390 23B5 001216 call sendmessage
0391 30FB 001217 movlw 0xFB ; 2
0392 23B5 001218 call sendmessage
0393 30E7 001219 movlw 0xE7 ; =
0394 23B5 001220 call sendmessage
0395 307F 001221 movlw 0x7F ; space
0396 23B5 001222 call sendmessage
0397 0008 001223 return
0398 001224
0398 001225 say_uk10
0398 30D3 001226 movlw 0xD3 ; u
0399 23B5 001227 call sendmessage
039A 30B1 001228 movlw 0xB1 ; k
039B 23B5 001229 call sendmessage
039C 307F 001230 movlw 0x7F ; space
039D 23B5 001231 call sendmessage
039E 30FD 001232 movlw 0xFD ; 1
039F 23B5 001233 call sendmessage
03A0 30EB 001234 movlw 0xEB ; 0
03A1 23B5 001235 call sendmessage
03A2 0008 001236 return
03A3 001237
03A3 001238 say_ok
03A3 30CF 001239 movlw 0xCF ; o
03A4 23B5 001240 call sendmessage
03A5 30B1 001241 movlw 0xB1 ; k
03A6 23B5 001242 call sendmessage
03A7 3077 001243 movlw 0x77 ; return
03A8 23B5 001244 call sendmessage
03A9 0008 001245 return
03AA 001246
03AA 001247 say_reset
03AA 30D9 001248 movlw 0xD9 ; r
03AB 23B5 001249 call sendmessage
03AC 30DB 001250 movlw 0xDB ; e
03AD 23B5 001251 call sendmessage
03AE 30BD 001252 movlw 0xBD ; s
03AF 23B5 001253 call sendmessage
03B0 30DB 001254 movlw 0xDB ; e
03B1 23B5 001255 call sendmessage
03B2 30D7 001256 movlw 0xD7 ; t
03B3 23B5 001257 call sendmessage
03B4 0008 001258 return
03B5 001259
03B5 001260
03B5 001261 sendmessage
03B5 009C 001262 movwf Savechar
03B6 21A0 001263 call actualtransmit
03B7 081C 001264 movf Savechar,W
03B8 39FE 001265 andlw 0xFE
03B9 21A0 001266 call actualtransmit
03BA 081C 001267 movf Savechar,W
03BB 0008 001268 return
03BC 001269
03BC 001270 getselection
03BC 2217 001271 call ATgetkey
03BD 2217 001272 call ATgetkey
03BE 2217 001273 call ATgetkey
03BF 3016 001274 movlw 0x16 ; was key 1 pressed and released
03C0 0219 001275 subwf ATchar,W
03C1 1903 001276 btfsc STATUS,Z ; skip if not equal
03C2 3401 001277 retlw 0x1
03C3 301E 001278 movlw 0x1E ; was key 2 pressed and released
03C4 0219 001279 subwf ATchar,W
03C5 1903 001280 btfsc STATUS,Z ; skip if not equal
03C6 3402 001281 retlw 0x2
03C7 3400 001282 retlw 0x0
03C8 001283
03C8 001284 writedata
03C8 081E 001285 movf eeaddress,W
03C9 0089 001286 movwf EEADR
03CA 081F 001287 movf eedata,W
03CB 0088 001288 movwf EEDATA
03CC 1683 001289 PAGE1
03CD 1508 001290 bsf EECON1,WREN ; EEPROM write enable
03CE 3055 001291 movlw 0x55
03CF 0089 001292 movwf EECON2
03D0 30AA 001293 movlw 0xAA
03D1 0089 001294 movwf EECON2
03D2 1488 001295 bsf EECON1,WR
03D3 001296 wait_write
03D3 1E08 001297 btfss EECON1,EEIF ; wait for write to finish
03D4 2BD3 001298 goto wait_write
03D5 0188 001299 clrf EECON1 ; EEPROM write disable & int accept
03D6 1283 001300 PAGE0
03D7 0008 001301 return
03D8 001302
03D8 001303
03D8 001304 readdata
03D8 0089 001305 movwf EEADR
03D9 1683 001306 PAGE1
03DA 1408 001307 bsf EECON1,RD ; EEPROM read
03DB 1283 001308 PAGE0
03DC 0808 001309 movf EEDATA,W
03DD 0008 001310 return
03DE 001311
03DE 001312
03DE 001313
03DE 001314
03DE 001315
03DE 001316
03DE 001317
03DE 001318 end
Used Symbols
-----------------------------------------
W 00000000
F 00000001
INDF 00000000
TMR0 00000001
PCL 00000002
STATUS 00000003
FSR 00000004
PORTA 00000005
PORTB 00000006
PCLATH 0000000A
INTCON 0000000B
OPTION_REG 00000081
TRISA 00000085
TRISB 00000086
GIE 00000007
T0IE 00000005
INTE 00000004
RBIE 00000003
T0IF 00000002
INTF 00000001
RBIF 00000000
NOT_RBPU 00000007
INTEDG 00000006
T0CS 00000005
T0SE 00000004
PSA 00000003
PS2 00000002
PS1 00000001
PS0 00000000
IRP 00000007
RP1 00000006
RP0 00000005
NOT_TO 00000004
NOT_PD 00000003
Z 00000002
DC 00000001
C 00000000
EEDATA 00000008
EEADR 00000009
EECON1 00000088
EECON2 00000089
RD 00000000
WR 00000001
WREN 00000002
WRERR 00000003
EEIF 00000004
ScrollLock 00000000
NumLock 00000001
CapsLock 00000002
Kclk 00000001
Kdat 00000000
Aclk 00000004
Adat 00000003
Arst 00000002
Ctrlbit 00000000
RAmigabit 00000001
LAmigabit 00000002
Keytype 00000000
Resetype 00000001
ScratchPadRam 0000000C
Capbit 0000000C
Capdown 0000000D
CtrlDown 0000000E
RESET 0000000F
Lights 00000010
Count3 00000011
ATparity 00000012
Make 00000013
Charbad 00000014
Oldchar 00000015
Amigachar 00000016
Count1 00000017
Count2 00000018
ATchar 00000019
tableoffset 0000001A
AltConfig 0000001B
Savechar 0000001C
returnvalue 0000001D
eeaddress 0000001E
eedata 0000001F
win95 00000020
Savechar2 00000021
ATtb1 00000001
ATtb2 00000081
lctrl 00000100
rctrl 00000103
swapscreen 00000106
prtscreen 0000010D
endkey 00000114
home 0000011B
pagedown 00000122
pageup 00000129
insert 00000130
break 00000137
longdelay 0000013E
dly 0000013F
fixeddelay 00000143
smalldelay 00000144
delay 00000145
amigatransmit 00000148
transok2 00000166
transok4 0000017D
transok3 00000184
nocontrol 00000195
actualtransmit 000001A0
actual2 000001A3
f 000001A6
ack 000001BD
ready 000001C5
syncup 000001CC
SendtoAT 000001D7
resend 000001D8
Send4 000001E8
Send5 000001F1
Send6 000001F5
Send7 000001FB
Send77 000001FD
Send78 00000200
Send79 00000205
Send7a 00000207
ATgetkey 00000217
skip1st 0000021C
skippy 0000021E
ATwait0 00000222
ATwait1 00000229
parity0 0000022D
parity1 0000022F
stop0 00000231
stop1 00000233
flash 0000023C
reset 0000024A
strobe 00000253
kill 0000025B
start 00000264
SpinUp 00000264
waitHD 0000026A
start2 0000026E
waitAT 00000284
ATstyle 00000291
ATnE1 000002A1
ATnEF12 000002B2
ATnE0F0 000002B7
ATnE012 000002BB
ATnE0 000002C0
ATdown 000002C6
ATup 000002CD
config 000002F9
askreset 00000332
say_select 0000035C
say_key 0000037E
say_option1 00000385
say_option2 0000038F
say_uk10 00000398
say_ok 000003A3
say_reset 000003AA
sendmessage 000003B5
getselection 000003BC
writedata 000003C8
wait_write 000003D3
readdata 000003D8
Used Defines
-----------------------------------------
PAGE0 bcf STATUS,RP0
PAGE1 bsf STATUS,RP0
PROGRAM MEMORY USAGE TABLE: '-' = not used 'X' = used
0000 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
0040 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
0080 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
00C0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
0100 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
0140 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
0180 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
01C0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
0200 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
0240 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
0280 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
02C0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
0300 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
0340 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
0380 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
03C0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXX-- ---------------- ----------------
Program Memory Words Used: 0990
Program Memory Words Free: 0034
Errors: 0